#@layout()

#define main()
<div class="wrap" id="wrap">
	<div class="container">
		<div class="row">
			<div class="main clearfix">
				<div class="col-xs-12 col-md-9 side-left">
					<div class="shadow-box">
						<h1 class="post-title">#(post.title)</h1>
						<div class="post-other clearfix">
							<span class="pull-left author"><a href="/uer/#(post.userId)">#(post.nickName)</a></span>
							<span class="pull-left time">#date(post.createAt, "YY-MM-dd")</span>
							<span class="pull-left time">浏览 #(post.views)</span>
							#if(post.tags)
							<ul class="tags">
								#for(tag : sk.convertStrToArray(post.tags,","))
								<li><a class="tag tag-sm" href="/tags/view/#(tag)">#(tag)</a></li>
								#end
							</ul>
							#end
							<span class="pull-right action-box"></span>
						</div>
						<div class="post-frame">
							
							<!--X1 CrossPlatform /begin -->
							<div class="video-wrap" id="video" >
							#if(post.video.indexOf("youku")>=0)
								<iframe height=498 width=100% src='#(post.video)' frameborder=0 'allowfullscreen'></iframe>
							#elseif(post.video.indexOf("v.qq.com")>=0)
								<iframe frameborder="0" width="100%" height="498" src="#(post.video)" allowfullscreen></iframe>
							#else
								<SCRIPT LANGUAGE=JavaScript>
								<!--
								/*
								* 跨平台方案X1（基于普通HTTP协议）=============
								* @param {Object} vID        ID
								* @param {Object} vWidth     播放器宽度设置
								* @param {Object} vHeight    播放器高度设置
								* @param {Object} vFile      播放器配置文件
								* @param {Object} vPlayer    播放器文件
								* @param {Object} vPic       视频缩略图
								* @param {Object} vCssurl    移动端CSS应用文件
								* @param {Object} vMp4url    视频文件地址
								
								* 跨平台方案说明=============================
								* 本实例请在IIS/Apache等网站环境下测试
								* 本实例实现HTTP协议下的跨平台
								* 本实例要求[视频文件地址]为mp4格式
								*/
								-->
								var vID        = ""; 
								var vWidth     = "100%";            //播放器宽度设置
								var vHeight    = 400;               //播放器高度设置
								var vFile      = "/assets/cuPlayer/CuSunV4set.xml";  //播放器配置文件
								var vPlayer    = "/assets/cuPlayer/player.swf?v=3.5";//播放器文件
								var vPic       = "/assets/cuPlayer/images/start.jpg";//视频缩略图
								var vCssurl    = "/assets/cuPlayer/images/mini.css"; //移动端CSS应用文件
								
								//适配PC,安卓,iOS请用mp4文件
								var vMp4url    = "http://#(serverIp)#(post.video)";  //视频文件地址
								
								</SCRIPT> 
								<script class="CuPlayerVideo" data-mce-role="CuPlayerVideo" type="text/javascript" src="/assets/cuPlayer/js/CuSunX1.min.js"></script>
							#end
							</div>
							<!--X1 CrossPlatform /end -->
							<div class="post-content">
								#(post.content)
							</div>
							<div class="tc mt40">
								#if(ret.isLikeActive == "active")
								<a rel="favor" class="icon-ding dib active" href="javascript:void(0);"></a>
								#else
								<a rel="favor" class="icon-ding dib" href="javascript:void(0);"></a>
								#end
								<p class="tc">
								<em id="favors">#(post.likeCount)</em>
								人赞过
								</p>
							</div>

							<div class="post-footer">
								#include("/_view/view/common/share.html")
							</div>

						</div>
					</div>

					<div id="chat" class="chats shadow-box">
					    <div class="chat_other">
					        <h4>全部评论: <i id="chat_count">#(commentNum)</i> 条</h4>
					    </div>
					    #if(!replyPage.list)
					    <ul class="its no-comment"><li><p>还没有评论, 快来占沙发吧!</p></li></ul>
					    #end
					    <div id="pager" class="text-center"></div>
					    <div class="cbox-wrap">
					        <div class="bottom_partcontent">  
						  		<div class="footer_communitypart">
						  			#include("/_view/view/common/comment.html")
						  			 <div class="cbox-title">我有话说(提示：您可以使用“@用户昵称”的方式进行回复哦): <span id="chat_reply" style="display:none;">@<i id="chat_to"></i></span>
					        		</div>
						  			<div style="margin-bottom: 20px; width: 100%;">
						  			  <span id="comment-span" name="comment-span"></span>
									  <textarea class="layui-textarea" id="articleComment" style="display: none"></textarea>
									  <button class="layui-btn fr" id="submit_btn">发表</button>
									</div> 
						  		</div>
						  </div>
					    </div>
					</div>
				</div>

				<div class="col-xs-12 col-md-3 side-right side-right-edit">
				<!--楼主-->
				#include("/_view/view/common/author.html")
				<!--热门用户-->
				#include("/_view/index/common/hot_user.html")
				<!--热门标签-->
				#include("/_view/index/common/hot_tag.html")
				<!--热门话题-->
				#include("/_view/index/common/hot_post.html")	
				<!--最新发表-->
				#include("/_view/index/common/new_post.html")
				</div>
			</div>

			
		</div>
	</div>
</div>
<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
	<div id="innerdiv" style="position:absolute;"><img id="bigimg" style="border:5px solid #fff;" src="" />
	</div>
</div>  
#end

#define js()
<script type="text/javascript" src="/assets/cuPlayer/js/swfobject.js"></script>
<script src="/assets/layui/lay/dest/layui.all.js"></script> 

<script type="text/javascript">
	//播放器,使用上面的跨平台方法，这里注释掉
	/*
	var so = new SWFObject("/assets/cuPlayer/player.swf","myCuPlayer","100%","460","9","#000000");
	so.addParam("allowfullscreen","true");
	so.addParam("allowscriptaccess","always");
	so.addParam("wmode","opaque");
	so.addParam("quality","high");
	so.addParam("salign","lt");
	//播放器设置文件-----------------------------
	so.addVariable("JcScpFile","/assets/cuPlayer/CuSunV4set.xml");
	//视频广告设置
	//so.addVariable("ShowJcScpAVideo","yes"); //是否显示前置视频广告
	//so.addVariable("JcScpAVideoW","500"); //前置广告宽度
	//so.addVariable("JcScpAVideoH","410"); //前置广告宽度
	//so.addVariable("JcScpAVideoPath","/assets/video/deyanVideo.mp4"); //前置视频广告地址
	//so.addVariable("JcScpAVideoLink","http://www.greennet.org.cn"); //前置视频广告链接
	//视频文件及略缩图--------------------------
	//so.addVariable("JcScpServer","rtmp://www.yoursite.com/vod");//流媒体服务器
	so.addVariable("JcScpAutoPlay","no"); //是否自动播放
	so.addVariable("JcScpVideoPath","http://#(serverIp)#(post.video)"); //视频文件地址
	so.addVariable("JcScpImg","/assets/images/banner-bg2.jpg");//视频缩略图
	so.addVariable("JcScpSharetitle","德眼直播"); 
	so.write("video");
	*/
	

	$(function(){
		//评论
		var map = {
				isLoading: false
				, submit_btn: $("#submit_btn")
			};

		$("#submit_btn").bind("click", function() {
			reply("/comment/saveReply", "#(post.id)", map);
			$('.no-comment').hide();
		});

		$("#articleComment").bind("keydown", function(e) {
			if ((e.ctrlKey || e.metaKey) && e.keyCode==13) {    // ctrl + 回车发送消息
				reply("/comment/saveReply", "#(post.id)", map);  // $("#submit_btn").trigger("click");   // 简写 $("#submit_btn").click();
				$('.no-comment').hide();
			}
		});
		
		//绑定点赞事件
        var bMap = {
            btn: $(".icon-ding")
            , isLoading: false
            , isAdd: #(ret.isLikeAdd)
        };
        bMap.btn.bind("click", function() {
        	console.log("click");
            like('posts', #(post.id), bMap);
        });
	});
	
		
</script>
#end